import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.io.Writer;


public class IOHomeWork {
	
	public static void main(String[] args) throws IOException{
		
		InputStream in = new FileInputStream("D:\\1.txt");
		Reader reader = new InputStreamReader(in);
		char[] cf = new char[1024];
		
		int c=0;
		int len =0;
		while((len=reader.read(cf))!= -1){
			for(int i =0;i<len;i++){
				System.out.print(cf[i]);
			}
			System.out.print((char)c);
		}
			
		in.close();
		reader.close();
		
		OutputStream out = new FileOutputStream("C:\\1.txt");
		Writer writer = new OutputStreamWriter(out);
		
		in = new FileInputStream("D:\\1.txt");
		reader = new InputStreamReader(in);
		c =0;
		while((c= reader.read()) != -1){
			
		}
	}
	
	
	
	
}


